function[averawimages]=AveAllImages(path)

numRuns = length(dir('*.h5'));
averawimages=[];
for I = 2:numRuns
    rawimages = cast(h5read([path '\run_' num2str(I-1) '.h5'],'/Image/image'),'double')/4;  %recasting from 2^14 to 2^16 bits
    averawimages=rawimages+averawimages;    
end